* CPS Final
* Analysis for "Peacekeepers without helmets: How violence shapes local peacebuilding by civilian peacekeepers"
* Authors: Hannah Smidt & Allard Duursma
* Note: The unit of analysis is the locality-week


set more off
version 13.0

capture cd "SET YOUR DIRECTORY WHERE YOU SAVED THE BELOW DATA FILE"

use "2022_11_07_dataFinal_max_agg_WeekEv.dta", clear

set scheme plotplainblind

drop if year==2018 & month>=11

gen date=yw(year, week)
format date %tw

egen id_str = concat(admin1Name admin2Name admin3Name admin3RefN)
encode id_str, gen(id)

duplicates tag id date, gen(tag2)
tab week if tag2>1
list id admin1Name admin3RefN admin2Name admin3Name year month date if tag2>0

* For linear models
capture gen ACLED_viol_any_ln = log(ACLED_viol_any+0.01)
capture gen ACLED_viol_any_l1_ln = log(ACLED_viol_any_l1+0.01)
capture gen LocalPeacebuild_AnyAss_ln = log(LocalPeacebuild_AnyAssistance+0.01)
capture gen un_military_ln = log(un_military+0.01)
capture gen un_military_l1_ln = log(un_military_l1+0.01)

* Labels
label var LocalPeacebuild_AnyAssistance "Local peacebuilding"
label var LocalPeacebuild_AnyAss_ln "Local peacebuilding logged"

label var SocialCohesion_AnyAssistance "PB for Reconciliation"
label var ConflictManage_AnyAssistance "PB for Conflict management"
label var StateAuthority_AnyAssistance "PB for State authority extension"
label var POC_AnyAssistance "PB for Protection of civilians"

label var ACLED_viol_any "All violence (ACLED)"
label var ACLED_viol_any_l1 "All violence (ACLED), lag 1m"
label var ACLED_viol_any_l2 "All violence (ACLED), lag 2m"
label var ACLED_viol_any_ln "All violence (ACLED) ln"
label var ACLED_viol_any_l1_ln "All violence (ACLED) ln, lag 1m"

label var ACLED_violenceAgainstCiv "One-sided viol. (ACLED)"
label var ACLED_viol_stateBased "State-based viol. (ACLED)"
label var ACLED_viol_nonState "Non-state viol. (ACLED)"

label var un_military "UN military numbers"
label var un_military_ln "UN military numbers, ln"
label var un_military_l1 "UN military numbers, lag 1m"
label var un_military_l1_ln "UN military numbers, ln lag 1m"
label var un_military_base "UN military deployed"
label var un_military_base_l1 "UN military deployed, lag 1m"

label var roadDensity "Road density"
label var distToCapital "Distance to capital"
label var Shape_Area_adm2 "Geographic size"
label var Pop_density "Population density"
label var ethnicFract "Ethnic fractionalization"
label var MoslemGroupSize "Muslim population size"

label var FoodInsecurity "Food insecurity"
label var ACLED_viol_any_3m_MA "Violence 3m average"
label var ACLED_viol_any_3m_MA_l1 "Violence 3m average, lag 1m" 
label var ACLED_viol_any_3m_MA_l2 "Violence 3m average, lag 2m" 
label var ACLED_NSA_Takes_Terr_cumsum "Non-state armed actor" 
label var ACLED_NSA_Takes_Terr_cumsum_l1 "Non-state armed actor, lag 1m"
label var anyCheckpoint "Roadblocks"

label var Diamonds "Diamonds"
label var diamondRoughPrice "Price"
label var distToBorder "Distance to border"


* Summary statistics
estpost sum LocalPeacebuild_AnyAssistance LocalPeacebuild_AnyAss_ln ///
SocialCohesion_AnyAssistance ConflictManage_AnyAssistance StateAuthority_AnyAssistance POC_AnyAssistance ///
ACLED_viol_any ACLED_viol_any_l1 ACLED_viol_any_l2 ///
ACLED_violenceAgainstCiv ACLED_viol_nonState ACLED_viol_stateBased ///
un_military_base un_military_base_l1 un_military  un_military_l1  ///
roadDensity distToCapital Shape_Area_adm2 Pop_density ethnicFract MoslemGroupSize FoodInsecurity ///
ACLED_viol_any_3m_MA ACLED_viol_any_3m_MA_l1 ///
ACLED_NSA_Takes_Terr_cumsum ACLED_NSA_Takes_Terr_cumsum_l1 anyCheckpoint ///
Diamonds diamondRoughPrice distToBorder
 
* Set panel data
tsset id date, weekly
* Number of obs=5,950 


* Control variables for different models
global controls roadDensity distToCapital Shape_Area_adm2 Pop_density FoodInsecurity ethnicFract MoslemGroupSize anyCheckpoint
global controls_fe FoodInsecurity anyCheckpoint


*************************************************************************************************
*************************************************************************************************
*** Testing hypothesis 1 across localities and *weekly* time periods
*************************************************************************************************
*************************************************************************************************

*************************
** Appendix Table B5 ****
*************************

* Model 5a (week)
nbreg LocalPeacebuild_AnyAssistance ACLED_viol_any  ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6, vce(cl id)
estat ic
mat es_ic = r(S)
local AIC: display %4.1f es_ic[1,5]
local BIC: display %4.1f es_ic[1,6]
outreg2 using "Tables/Table1week.doc", replace  ctitle(Model 5a) label dec(3) addtext(Location FE, No) addstat(AIC, `AIC', BIC, `BIC') alpha(0.01, 0.05, 0.1) symbol(**, *, +) eqdrop(lnalpha)

* Model 5a
nbreg LocalPeacebuild_AnyAssistance ACLED_viol_any  ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls, vce(cl id)
estat ic
mat es_ic = r(S)
local AIC: display %4.1f es_ic[1,5]
local BIC: display %4.1f es_ic[1,6]
outreg2 using "Tables/Table1week.doc", append  ctitle(Model 5b) label dec(3) addtext(Location FE, No) addstat(AIC, `AIC', BIC, `BIC') alpha(0.01, 0.05, 0.1) symbol(**, *, +) eqdrop(lnalpha)

* Model 5c
set seed 1234
xtnbreg LocalPeacebuild_AnyAssistance  ACLED_viol_any ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls_fe, fe vce(bootstrap, reps(100)) 
estat ic
mat es_ic = r(S)
local AIC: display %4.1f es_ic[1,5]
local BIC: display %4.1f es_ic[1,6]
outreg2 using "Tables/Table1week.doc", append ctitle(Model 5c) label dec(3) addtext(Location FE, Yes) addstat(AIC, `AIC', BIC, `BIC') alpha(0.01, 0.05, 0.1) symbol(**, *, +) eqdrop(lnalpha)

* Estimates for plot (Not that we do not use bootstrap SE as they are almost exactly the same as the numerically derived ones, see Model 1c)
capture drop estimate
capture drop upper
capture drop lower
gen estimate = .
gen upper = .
gen lower = .
quietly: xtnbreg LocalPeacebuild_AnyAssistance  ACLED_viol_any ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls_fe, fe 
margins, predict(nu0) at(ACLED_viol_any = (0 1) (mean) _all) contrast(atcontrast(r)) post
matrix myV = e(V)
matrix myB = e(b)
replace estimate = myB[1,1] in 1
replace upper = myB[1,1] + sqrt(myV[1,1])*1.96 in 1
replace lower = myB[1,1] - sqrt(myV[1,1])*1.96 in 1
quietly: xtnbreg LocalPeacebuild_AnyAssistance  ACLED_viol_any ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls_fe, fe 
margins, predict(nu0) at(ACLED_viol_any_l1 = (0 1) (mean) _all) contrast(atcontrast(r)) post
matrix myV = e(V)
matrix myB = e(b)
replace estimate = myB[1,1] in 2
replace upper = myB[1,1] + sqrt(myV[1,1])*1.96 in 2
replace lower = myB[1,1] - sqrt(myV[1,1])*1.96 in 2
quietly: xtnbreg LocalPeacebuild_AnyAssistance  ACLED_viol_any ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls_fe, fe 
margins, predict(nu0) at(ACLED_viol_any_l2 = (0 1) (mean) _all) contrast(atcontrast(r)) post
matrix myV = e(V)
matrix myB = e(b)
replace estimate = myB[1,1] in 3
replace upper = myB[1,1] + sqrt(myV[1,1])*1.96 in 3
replace lower = myB[1,1] - sqrt(myV[1,1])*1.96 in 3
quietly: xtnbreg LocalPeacebuild_AnyAssistance  ACLED_viol_any ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls_fe, fe 
margins, predict(nu0) at(ACLED_viol_any_l3 = (0 1) (mean) _all) contrast(atcontrast(r)) post
matrix myV = e(V)
matrix myB = e(b)
replace estimate = myB[1,1] in 4
replace upper = myB[1,1] + sqrt(myV[1,1])*1.96 in 4
replace lower = myB[1,1] - sqrt(myV[1,1])*1.96 in 4
quietly: xtnbreg LocalPeacebuild_AnyAssistance  ACLED_viol_any ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls_fe, fe 
margins, predict(nu0) at(ACLED_viol_any_l4 = (0 1) (mean) _all) contrast(atcontrast(r)) post
matrix myV = e(V)
matrix myB = e(b)
replace estimate = myB[1,1] in 5
replace upper = myB[1,1] + sqrt(myV[1,1])*1.96 in 5
replace lower = myB[1,1] - sqrt(myV[1,1])*1.96 in 5
quietly: xtnbreg LocalPeacebuild_AnyAssistance  ACLED_viol_any ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls_fe, fe 
margins, predict(nu0) at(ACLED_viol_any_l5 = (0 1) (mean) _all) contrast(atcontrast(r)) post
matrix myV = e(V)
matrix myB = e(b)
replace estimate = myB[1,1] in 6
replace upper = myB[1,1] + sqrt(myV[1,1])*1.96 in 6
replace lower = myB[1,1] - sqrt(myV[1,1])*1.96 in 6
quietly: xtnbreg LocalPeacebuild_AnyAssistance  ACLED_viol_any ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls_fe, fe 
margins, predict(nu0) at(ACLED_viol_any_l6 = (0 1) (mean) _all) contrast(atcontrast(r)) post
matrix myV = e(V)
matrix myB = e(b)
replace estimate = myB[1,1] in 7
replace upper = myB[1,1] + sqrt(myV[1,1])*1.96 in 7
replace lower = myB[1,1] - sqrt(myV[1,1])*1.96 in 7

capture drop yaxis
gen yaxis=.
replace yaxis = 1 in 1
replace yaxis = 2 in 2
replace yaxis = 3 in 3
replace yaxis = 4 in 4
replace yaxis = 5 in 5
replace yaxis = 6 in 6
replace yaxis = 7 in 7
twoway scatter estimate yaxis, msize(medlarge) || rspike upper lower yaxis, vertical lwidth(medthick) lcolor(gray)  ///
							xlabel(7 "6w"  ///
								   6 "5w"  ///
							       5 "4w"  ///
								   4 "3w" ///
								   3 "2w" ///
								   2 "1w" /// 
								   1 "0w", ///
							labsize(medsmall)   ) ///
							lstyle(none) yline(0) /// 
							xtitle("Violence measured contemporaneously and 1 to 6 weeks previously" "(Fixed Effects Model)", size(medsmall) ) ytitle("Effect size") ///
							legend( order(1 "Predicted value" 2 "95% CI") size(medsmall) ) 
graph export "./Figures/Figure_H1H2_week_fe.png", replace


**********************************************************************
** Additional plot for estimates from Model 1b (NOT IN MANUSCRIPT) ***
**********************************************************************

* Estimates for plot
capture drop estimate
capture drop upper
capture drop lower
gen estimate = .
gen upper = .
gen lower = .
quietly: nbreg LocalPeacebuild_AnyAssistance ACLED_viol_any ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls, vce(cl id)
margins, predict(n) at(ACLED_viol_any = (0 1) (mean) _all) contrast(atcontrast(r)) post
matrix myV = e(V)
matrix myB = e(b)
replace estimate = myB[1,1] in 1
replace upper = myB[1,1] + sqrt(myV[1,1])*1.96 in 1
replace lower = myB[1,1] - sqrt(myV[1,1])*1.96 in 1
quietly: nbreg LocalPeacebuild_AnyAssistance ACLED_viol_any ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls, vce(cl id)
margins, predict(n) at(ACLED_viol_any_l1 = (0 1) (mean) _all) contrast(atcontrast(r)) post
matrix myV = e(V)
matrix myB = e(b)
replace estimate = myB[1,1] in 2
replace upper = myB[1,1] + sqrt(myV[1,1])*1.96 in 2
replace lower = myB[1,1] - sqrt(myV[1,1])*1.96 in 2
quietly: nbreg LocalPeacebuild_AnyAssistance ACLED_viol_any ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls, vce(cl id)
margins, predict(n) at(ACLED_viol_any_l2 = (0 1) (mean) _all) contrast(atcontrast(r)) post
matrix myV = e(V)
matrix myB = e(b)
replace estimate = myB[1,1] in 3
replace upper = myB[1,1] + sqrt(myV[1,1])*1.96 in 3
replace lower = myB[1,1] - sqrt(myV[1,1])*1.96 in 3
quietly: nbreg LocalPeacebuild_AnyAssistance ACLED_viol_any ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls, vce(cl id)
margins, predict(n) at(ACLED_viol_any_l3 = (0 1) (mean) _all) contrast(atcontrast(r)) post
matrix myV = e(V)
matrix myB = e(b)
replace estimate = myB[1,1] in 4
replace upper = myB[1,1] + sqrt(myV[1,1])*1.96 in 4
replace lower = myB[1,1] - sqrt(myV[1,1])*1.96 in 4
quietly: nbreg LocalPeacebuild_AnyAssistance ACLED_viol_any ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls, vce(cl id)
margins, predict(n) at(ACLED_viol_any_l4 = (0 1) (mean) _all) contrast(atcontrast(r)) post
matrix myV = e(V)
matrix myB = e(b)
replace estimate = myB[1,1] in 5
replace upper = myB[1,1] + sqrt(myV[1,1])*1.96 in 5
replace lower = myB[1,1] - sqrt(myV[1,1])*1.96 in 5
quietly: nbreg LocalPeacebuild_AnyAssistance ACLED_viol_any ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls, vce(cl id)
margins, predict(n) at(ACLED_viol_any_l5 = (0 1) (mean) _all) contrast(atcontrast(r)) post
matrix myV = e(V)
matrix myB = e(b)
replace estimate = myB[1,1] in 6
replace upper = myB[1,1] + sqrt(myV[1,1])*1.96 in 6
replace lower = myB[1,1] - sqrt(myV[1,1])*1.96 in 6
quietly: nbreg LocalPeacebuild_AnyAssistance ACLED_viol_any ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls, vce(cl id)
margins, predict(n) at(ACLED_viol_any_l6 = (0 1) (mean) _all) contrast(atcontrast(r)) post
matrix myV = e(V)
matrix myB = e(b)
replace estimate = myB[1,1] in 7
replace upper = myB[1,1] + sqrt(myV[1,1])*1.96 in 7
replace lower = myB[1,1] - sqrt(myV[1,1])*1.96 in 7

* Plot Model 2
capture drop yaxis
gen yaxis=.
replace yaxis = 1 in 1
replace yaxis = 2 in 2
replace yaxis = 3 in 3
replace yaxis = 4 in 4
replace yaxis = 5 in 5
replace yaxis = 6 in 6
replace yaxis = 7 in 7
twoway scatter estimate yaxis, msize(medlarge) || rspike upper lower yaxis, vertical lwidth(medthick) lcolor(gray)  ///
							xlabel(7 "6w"  ///
								   6 "5w"  ///
							       5 "4w"  ///
								   4 "3w" ///
								   3 "2w" ///
								   2 "1w" /// 
								   1 "0w", ///
							labsize(medsmall)   ) ///
							lstyle(none) yline(0) /// 
							xtitle("Violence measured contemporaneously and 1 to 6 weeks previously"  "(Pooled Model)", size(medsmall) ) ytitle("Effect size") ///
							legend( order(1 "Predicted value" 2 "95% CI") size(medsmall) ) 
graph export "./Figures/Figure_H1H2_week.png", replace




********************************************************************************************************************************************************************************
*** Additional analyses across weeks disaggregating peacebuilding activities by type (NOT IN MANUSCRIPT AND ONLY REFERRED TO BRIEFLY IN APPENDIX G)
********************************************************************************************************************************************************************************

** Civilian Protection

* Model 1a
nbreg POC_AnyAssistance ACLED_viol_any  ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6, vce(cl id)
estat ic
mat es_ic = r(S)
local AIC: display %4.1f es_ic[1,5]
local BIC: display %4.1f es_ic[1,6]
outreg2 using "Tables/Table1week.doc", replace  ctitle(Model 1a) label dec(3) addtext(Location FE, No) addstat(AIC, `AIC', BIC, `BIC') alpha(0.01, 0.05, 0.1) symbol(**, *, +) eqdrop(lnalpha)

* Model 1a
nbreg POC_AnyAssistance ACLED_viol_any  ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls, vce(cl id)
estat ic
mat es_ic = r(S)
local AIC: display %4.1f es_ic[1,5]
local BIC: display %4.1f es_ic[1,6]
outreg2 using "Tables/Table1week.doc", append  ctitle(Model 1b) label dec(3) addtext(Location FE, No) addstat(AIC, `AIC', BIC, `BIC') alpha(0.01, 0.05, 0.1) symbol(**, *, +) eqdrop(lnalpha)

* Model 1c
set seed 1234
xtnbreg POC_AnyAssistance ACLED_viol_any ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls_fe, fe 
estat ic
mat es_ic = r(S)
local AIC: display %4.1f es_ic[1,5]
local BIC: display %4.1f es_ic[1,6]
outreg2 using "Tables/Table1week.doc", append ctitle(Model 1c) label dec(3) addtext(Location FE, Yes) addstat(AIC, `AIC', BIC, `BIC') alpha(0.01, 0.05, 0.1) symbol(**, *, +) eqdrop(lnalpha)


** Conflict management

* Model 1a
nbreg ConflictManage_AnyAssistance ACLED_viol_any  ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6, vce(cl id)
estat ic
mat es_ic = r(S)
local AIC: display %4.1f es_ic[1,5]
local BIC: display %4.1f es_ic[1,6]
outreg2 using "Tables/Table1week.doc", replace  ctitle(Model 1a) label dec(3) addtext(Location FE, No) addstat(AIC, `AIC', BIC, `BIC') alpha(0.01, 0.05, 0.1) symbol(**, *, +) eqdrop(lnalpha)

* Model 1a
nbreg ConflictManage_AnyAssistance ACLED_viol_any  ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls, vce(cl id)
estat ic
mat es_ic = r(S)
local AIC: display %4.1f es_ic[1,5]
local BIC: display %4.1f es_ic[1,6]
outreg2 using "Tables/Table1week.doc", append  ctitle(Model 1b) label dec(3) addtext(Location FE, No) addstat(AIC, `AIC', BIC, `BIC') alpha(0.01, 0.05, 0.1) symbol(**, *, +) eqdrop(lnalpha)

* Model 1c
set seed 1234
xtnbreg ConflictManage_AnyAssistance ACLED_viol_any ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls_fe, fe 
estat ic
mat es_ic = r(S)
local AIC: display %4.1f es_ic[1,5]
local BIC: display %4.1f es_ic[1,6]
outreg2 using "Tables/Table1week.doc", append ctitle(Model 1c) label dec(3) addtext(Location FE, Yes) addstat(AIC, `AIC', BIC, `BIC') alpha(0.01, 0.05, 0.1) symbol(**, *, +) eqdrop(lnalpha)


** Reconciliation

* Model 1a
nbreg SocialCohesion_AnyAssistance ACLED_viol_any  ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6, vce(cl id)
estat ic
mat es_ic = r(S)
local AIC: display %4.1f es_ic[1,5]
local BIC: display %4.1f es_ic[1,6]
outreg2 using "Tables/Table1week.doc", replace  ctitle(Model 1a) label dec(3) addtext(Location FE, No) addstat(AIC, `AIC', BIC, `BIC') alpha(0.01, 0.05, 0.1) symbol(**, *, +) eqdrop(lnalpha)

* Model 1a
nbreg SocialCohesion_AnyAssistance ACLED_viol_any  ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls, vce(cl id)
estat ic
mat es_ic = r(S)
local AIC: display %4.1f es_ic[1,5]
local BIC: display %4.1f es_ic[1,6]
outreg2 using "Tables/Table1week.doc", append  ctitle(Model 1b) label dec(3) addtext(Location FE, No) addstat(AIC, `AIC', BIC, `BIC') alpha(0.01, 0.05, 0.1) symbol(**, *, +) eqdrop(lnalpha)

* Model 1c
set seed 1234
xtnbreg SocialCohesion_AnyAssistance ACLED_viol_any ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls_fe, fe 
estat ic
mat es_ic = r(S)
local AIC: display %4.1f es_ic[1,5]
local BIC: display %4.1f es_ic[1,6]
outreg2 using "Tables/Table1week.doc", append ctitle(Model 1c) label dec(3) addtext(Location FE, Yes) addstat(AIC, `AIC', BIC, `BIC') alpha(0.01, 0.05, 0.1) symbol(**, *, +) eqdrop(lnalpha)


* Model 1a
nbreg StateAuthority_AnyAssistanceACLED_viol_any  ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6, vce(cl id)
estat ic
mat es_ic = r(S)
local AIC: display %4.1f es_ic[1,5]
local BIC: display %4.1f es_ic[1,6]
outreg2 using "Tables/Table1week.doc", replace  ctitle(Model 1a) label dec(3) addtext(Location FE, No) addstat(AIC, `AIC', BIC, `BIC') alpha(0.01, 0.05, 0.1) symbol(**, *, +) eqdrop(lnalpha)

* Model 1a
nbreg StateAuthority_AnyAssistance ACLED_viol_any  ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls, vce(cl id)
estat ic
mat es_ic = r(S)
local AIC: display %4.1f es_ic[1,5]
local BIC: display %4.1f es_ic[1,6]
outreg2 using "Tables/Table1week.doc", append  ctitle(Model 1b) label dec(3) addtext(Location FE, No) addstat(AIC, `AIC', BIC, `BIC') alpha(0.01, 0.05, 0.1) symbol(**, *, +) eqdrop(lnalpha)

* Model 1c
set seed 1234
xtnbreg StateAuthority_AnyAssistance ACLED_viol_any ACLED_viol_any_l1 ACLED_viol_any_l2  ACLED_viol_any_l3  ACLED_viol_any_l4  ACLED_viol_any_l5  ACLED_viol_any_l6 $controls_fe, fe 
estat ic
mat es_ic = r(S)
local AIC: display %4.1f es_ic[1,5]
local BIC: display %4.1f es_ic[1,6]
outreg2 using "Tables/Table1week.doc", append ctitle(Model 1c) label dec(3) addtext(Location FE, Yes) addstat(AIC, `AIC', BIC, `BIC') alpha(0.01, 0.05, 0.1) symbol(**, *, +) eqdrop(lnalpha)

